<?php $servicioUtil = new utilClass(); ?>

<?php $servicioProveedor = new proveedorClass(); ?>
<?php $listaMoneda       = $servicioUtil->listaTipoMoneda(); ?>

<?php $criteriaProveedor = $servicioProveedor->listadoProveedores("", "", "", 1); ?>
<?php $listaProveedor    = ProveedorPeer::doSelect($criteriaProveedor); ?>


<?php if($sf_user->hasAttribute($nombreSession)): ?>
<?php $listaSession = $sf_user->getAttribute($nombreSession); ?>
        <table id="resultadoContrato">
            <tr  class="cabeceraDetalle">
                <td style="width: 182px"> <label>Proveedor</label> </td>
                <td style="width: 170px"> <label>N&uacute;mero de Contrato</label> </td>
                <td style="width: 120px"> <label>Monto</label> </td>
                <td style="width: 120px"> <label>Moneda</label> </td>
                <td style="width: 100px"> <label>Tipo de Cambio</label> </td>
                <td style="width: 145px"> <label>Opciones</label> </td>
            </tr>
           <?php  foreach($listaSession as $obj){ ?>
            <tr id="filaContrato-<?php echo $obj['id']; ?>">
                <td style="width: 170px;text-align: center">
                    <label id="lblproveedor-<?php echo $obj['id']; ?>"><?php echo $obj['proveedorName'] ?></label>
                    <?php if(count($listaProveedor)>0): ?>
                            <select style="width: 120px;display: none;" id="cboproveedor-<?php echo $obj['id']; ?>" name="cboproveedor-<?php echo $obj['id']; ?>">
                                <?php foreach($listaProveedor as $row): ?>
                                    <option value="<?php echo $row->getId() ?>"><?php echo $row->getRazonSocial() ?></option>                           
                                <?php endforeach; ?>
                            </select>
                   <?php endif; ?>
                </td>
                <td style="width: 170px;text-align: center"><label id="lblnumerocontrato-<?php echo $obj['id']; ?>"><?php echo $obj['numerocontrato'] ?></label><input type="text" style="display: none;text-align: center;width: 170px" id="txtnumerocontrato-<?php echo $obj['id']; ?>" /></td>
                <td style="width: 120px;text-align: center"><label id="lblmonto-<?php echo $obj['id']; ?>"><?php echo $obj['monto'] ?></label><input type="text" style="display: none;text-align: center;width: 80px" id="txtmonto-<?php echo $obj['id']; ?>" /></td>
                <td style="width: 120px;text-align: center">
                    <label id="lblmoneda-<?php echo $obj['id']; ?>"><?php echo $obj['monedaBanco'] ?></label>
                    <select style="width: 65px;display: none;" id="cbomondea-<?php echo $obj['id']; ?>">" >
                        <?php foreach ($listaMoneda as $value) : ?>
                              <option value="<?php echo $value->getParametro(); ?>"><?php echo $value->getParametro(); ?></option>                               
                         <?php endforeach; ?>
                    </select>
                </td>
                <td style="width: 100px;text-align: center"><label id="lbltipocambio-<?php echo $obj['id']; ?>"><?php echo $obj['tipocambio'] ?></label><input type="text" style="display: none;text-align: center;width: 80px" id="txttipoCambio-<?php echo $obj['id']; ?>" /></td>
                <td style="width: 145px; text-align: center"><a title="grabar" style="display: none;" id="grabarContrato-<?php echo $obj['id']; ?>" href="javascript:editarDetalleContrato(<?php echo $obj['id']; ?>);"><?php echo image_tag('icon_save.png') ?></a><a  id="editarContrato-<?php echo $obj['id'] ?>" href="javascript:changeFormatTextContrato(<?php echo $obj['id']; ?>)"><?php echo image_tag('icon_edit.png') ?></a>&nbsp;&nbsp;&nbsp;&nbsp;<a id="eliminar" href="javascript:eliminarDetalleContrato(<?php echo $obj['id']; ?>);"><?php echo image_tag('icon_delete.png') ?></a></td>
            </tr>
           <?php }; ?>
        </table>  
<?php endif; ?>